<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li
      v-for="(item, index) in showLsit"
      :key="item.id"
      :class="{ completed: item.done === true }"
    >
      <div class="view">
        <input
          @click="changStatus(index)"
          :id="item.id"
          class="toggle"
          type="checkbox"
          v-model="item.done"
        />
        <label :for="item.id">{{ item.info }}</label>
        <button class="destroy" @click="deletList(item.id)"></button>
      </div>
    </li>
  </ul>
</template>

<script>
import { mapState, mapMutations ,mapGetters} from "vuex";
export default {
  data() {
    return {};
  },
  computed: {
    ...mapState(["list"]),
    ...mapGetters(['showLsit'])
  },
  methods: {
    ...mapMutations(["deletList","changStatus"]),
    
  },
};
</script>
<style></style>
